#!/bin/sh -e

# $1 = version

TAR=../liblaf-widget-java_$1.orig.tar.gz
DIR=liblaf-widget-java-$1.orig
ZIP=laf-widget-all.zip

wget https://laf-widget.dev.java.net/files/documents/5097/50235/laf-widget-all.zip

# clean up the upstream tarball
unzip -d $DIR $ZIP
GZIP=--best tar -c -z -f $TAR --exclude '$DIR/docs*' -X debian/orig.exclude $DIR
rm -rf $DIR $ZIP

# move to directory 'tarballs'
if [ -r .svn/deb-layout ]; then
  . .svn/deb-layout
  mv $TAR $origDir
  echo "moved $TAR to $origDir"
fi

exit 0
